//
// Created by 吴锐 on 2022/2/25.
//

#include "iostream"

using namespace std;

class Person {
public:
    string name;
    int age;

    Person(){
    }

    Person(string name, int age){
        this->name = name;
        this->age = age;
    }

    bool operator==(Person& p){
        if(this->name == p.name && this->age == age){
            return true;
        }else{
            return false;
        }
    }

    bool operator!=(Person& p){
        if(this->name == p.name && this->age == age){
            return false;
        }else{
            return true;
        }
    }
};

void test01(){
    Person p1("Tom", 18);
    Person p2("niuma", 18);

    if(p1 == p2){
        cout << "p1 和 p2 是相等的" << endl;
    }else{
        cout << "p1 和 p2 是不相等的" << endl;
    }

    if(p1 != p2){
        cout << "p1 和 p2 是不相等的" << endl;
    }else {
        cout << "p1 和 p2 是相等的" << endl;
    }
}

int main(){
    test01();
    return 0;
}